package com.ycb.feign;

import com.ycb.entity.Goods;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author 黄泽群
 * @since 2023-12-11
 */
@FeignClient(
        value = "seata-goods",
        contextId = "seata-goods.goods",
        path = "/"
)
public interface GoodsClient {

    @GetMapping("get-by-id")
    Goods getById(@RequestParam("id") Integer id);

    @PostMapping("sub-stock")
    Goods subStock(@RequestParam("id") Integer id,@RequestParam("num") Integer num);

}
